package com.zhongjianjian.zookeeper;
import com.zhongjianjian.zookeeper.service.ZkStockService;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
/**
 * @类名: com.zhongjianjian.zookeeper
 * @作者: lgt
 * @创建时间: 2020-02-28 19:32
 * @描述:
 **/
@RestController
public class TestZookeeperLockController {
    @Autowired
    private ZkStockService zkStockService;

    @RequestMapping("zkLockTest")
    public String zkLock(@RequestBody Map<String,String> map) throws Exception {

        zkStockService.lockStock(map);

        return "ok";
    }



}
